<template>
  <el-tooltip effect="dark" placement="top">
    <div slot="content">
      <slot>提示！</slot>
    </div>
    <i
      class="el-icon-question icon"
      @click.stop="clickPrompt"
      :style="{
        cursor: isClick ? 'pointer' : 'default'
      }"
    ></i>
  </el-tooltip>
</template>

<script>
export default {
  name: 'Prompt',
  props: {
    isClick: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    clickPrompt() {
      if (!this.isClick) {
        return;
      }
      alert('点击Prompt！');
    }
  }
};
</script>

<style scoped lang="scss">
.icon {
  font-size: 20px;
  margin-left: 10px;
  vertical-align: middle;
}
</style>
